<?
// *************************************
// * calendar.php allows the admin to
// * Add/View/Update/Delete events.
// *************************************
define('SITE_AREA', 'calendar');
$jsFile = 'jsCalendar.js|jsCalendarInit.js';
require_once('includes/appInit.php');
include('includes/ajax/sysData.php');
include('includes/ajax/ajaxCalendar.php');

$googleMaps = 1;
$editor     = 1;
require_once('includes/header.php');
$yr=date('Y');
$mo=date('n');
?>
<div id="addEditFormDiv" style="display: none;"></div>	
	
<div id="content0" style="padding: 10px; width: 98%;" class="x-layout-inactive-content">
	<div id="buttonNew" style="float: left; width: 180px;">
		<a href="#" class="coolButton buttonBGBlueGray" onClick="calendarSupportObj.openEventForm('<? echo date('Y-m-d'); ?>','add'); return false;"><span class="add">New Event</span></a>
	</div>
	<div id="statusDiv" style="float: left; height: 30px;"></div>
	<div style="clear: left; height: 5px;"></div>
	<div id="formTitle"></div>
	<div id="content0FormDiv">
	
	<div id="formNewEvent" class="blueBox" style="display: none;">		
		<input type="hidden" id="formAction" />
		<input type="hidden" id="completeDate" />
		<input type="hidden" id="thisMonth" value="<?=$mo; ?>" />
		<input type="hidden" id="thisYear" value="<?=$yr; ?>" />
		<input type="hidden" id="calendarPage" />
		
		<p><div style="float: left; margin-left: 5px; width: 230px;">
				<label class="vertLabelSmall">Event Type</label>
				<select size="1" style="width: 200px;" id="eType">
				<option>Select...</option>
				<option></option>
				<? echo getCategories('Calendar','select'); ?>
				</select>	
			</div>
			<div style="float: left; margin-top: 15px;">
				<p><input type="checkbox" id="ePublic" value="1" checked />
				<b>Make this event public.</b></p>
			</div>
			<div style="clear: left;"></div>	
		</p>
		
		<p><label class="vertLabelSmall">Event Name</label>
		<input type="text" style="width: 500px; margin-right: 5px;" id="eName" />
		</p>
		
		<p><label class="vertLabelSmall">Description of Event</label>
		<textarea name="eDesc" id="eDesc" class="editorSimple" style="width: 600px; height: 200px;"></textarea>
		</p>
										
		<p><label class="vertLabelSmall">Start Date/Time</label>
		<div style="float: left; margin-left: 5px; width: 130px;"><input type="text" style="width: 100px;" id="eDateStart" /></div>
		<div style="float: left;"><? echo timeSelect(null,null,'Start'); ?></div>
		<div style="clear: left;"></div>
		</p>
		
		<p><div style="height: 20px; margin-top: 10px; margin-left: 7px;"><input type="checkbox" id="eReg" value="1" />
				<b>This event requires registration.</b></div></p>
		
		<div id="showAdvancedLink" style="margin-left: 5px; height: 30px;">
			<label class="vertLabelSmall"><a href="#" onClick="calendarSupportObj.showAdvancedForm(); return false;"><b>Show advanced form</b></a></label>
		</div>	
		
		<div id="formAdvancedPanel" style="display: none;">
		
		<p><label class="vertLabelSmall">End Date/Time</label>
		<div style="float: left; margin-left: 5px; width: 130px;"><input type="text" style="width: 100px;" id="eDateEnd" /></div>
		<div style="float: left;"><? echo timeSelect(null,null,'End'); ?></div>
		<div style="clear: left;"></div>
		</p>		
		
		<p><label class="vertLabelSmall">Event Speakers</label>
		<textarea id="eSpeakers" style="width: 400px; height: 50px;"></textarea></p>
							
		<p><label class="vertLabelSmall">Event Website URL</label>
		<input type="text" style="width: 400px;" id="eURL" value="http://" /></p>
		
		<p><label class="vertLabelSmall">Event Registration URL</label>
		<input type="text" style="width: 400px;" id="eRegURL" value="http://" /></p>
					
					
		<p><label class="vertLabelSmall">Location</label>
		<input type="text" style="width: 400px;" id="eLocation" name="eLocation" /></p>
		
		<p><label class="vertLabelSmall">Address</label>
		<textarea id="eAddress" style="width: 400px; height: 50px;"></textarea></p>
			
		<p><label class="vertLabelSmall">City, State, Zip</label>
		<input type="text" style="width: 200px;" id="eCity" />
		<select id="eState" style="width: 94px;" size="1">
		<? include('includes/states.html'); ?>
		</select>
		<input type="text" style="width: 100px;" id="eZip" />
		</p>
		
		<p><label class="vertLabelSmall">Contact Person</label>
		<input type="text" style="width: 400px;" id="eContactPerson" /></p>
		
		<p><label class="vertLabelSmall">Contact Phone Number</label>
		<input type="text" style="width: 400px;" id="eContactPhone" /></p>
		
		<p><label class="vertLabelSmall">Contact Email Address</label>
		<input type="text" style="width: 400px;" id="eContactEmail" /></p>
		
		<p>	<label class="vertLabelSmall">Venue Size</label>
			<input type="text" style="width: 150px;" id="eVenueSize" />	
		</p>	
		
		</div>
										
		<div style="float: left; margin-left: 5px; margin-right: 5px;">
			<a href="#" class="coolButton buttonBGBlueGray" onClick="calendarUpdateObj.saveEvent(); return false;"><span class="save">Save</span></a>
		</div>
		<div style="float: left;">
			<a href="#" class="coolButton buttonBGRed" onClick="calendarSupportObj.closeEventForm(); return false;"><span class="cancel">Cancel</span></a>
		</div>
		<div style="clear: left;"></div>
				
			
	</div>
	</div>
	<div><h1 id="dateTitleDisplay"></h1></div>
	
	<div id="calendarNavigation">
	<div id="calendarViewNav" style="float: left;">
		<!-- <div title="Single day view" onClick="alert('Feature not ready yet.');" class="calButtonDay" style="float: left;"></div>
		<div title="Week view" onClick="alert('Feature not ready yet.');" class="calButtonWeek" style="float: left;"></div>
		<div title="Whole month view" onClick="newMonthBig(0,0); return false;" class="calButtonMonth" style="float: left;"></div>
		<div title="Event list view" onClick="viewEventList(0,0); return false;" class="calButtonList" style="float: left;"></div>
		-->
		<div style="clear: left;"></div>
	</div>
	<div class="gridNavTab" style="float: right;">
		<table style="width: 100%; margin: 4px 0 0 3px;">
		<tr>
			<td>
				<a href="#" onClick="calendarNavigateObject.monthPrevNext('prev'); return false;" title="Last Month">
				<img src="images/button_prev.gif" style="border: none;" alt="Last Month"></a>
			</td>
			<td>			
				<a href="#" onClick="calendarNavigateObject.monthPrevNext('next'); return false;" title="Next Month">
				<img src="images/button_next.gif" style="border: none;" alt="Next Month"></a>
			</td>
			<td style="text-align: right;">
				<select style="width: 100px;" id="monthSelect" size="1">
					<?
					for($a=0;$a<=11;$a++) {
						$monthNum = $a+1;
						echo '<option value="'.$monthNum.'"';
						if ($mo == $monthNum) {
							echo ' selected';
						}
						echo '>'.$monthNameLongArray[$a].'</option>';
					}
					?>					
				</select>
				<select style="margin-left: 2px; width: 60px;" id="yearSelect" size="1">
				<?
				for($yy=($yr-50);$yy<=($yr+10);$yy++) {
					echo '<option value="'.$yy.'"';
					if ($yr == $yy) {
						echo ' selected';
					}
					echo '>'.$yy.'</option>';	
				}
				?>
				</select>
			</td>
			<td>	
				<input type="button" style="margin: 0 5px 0 2px;" class="buttonGo" onClick="calendarNavigateObject.newMonthRelay();" />
			</td>
		</tr>
		</table>
	</div>
	<div style="clear: both;"></div>
</div>		
	<div id="calContainerFull"></div>	
</div>
		
<div id="south"></div>	  
<? include("includes/footer.php"); ?>